package charbai;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;

public class Filets {
public static void main(String[] args) throws IOException {
	File file=new File("e:/java.txt");
	File file1=new File("e:\\java.txt");
	file1.createNewFile();
	file.createNewFile();
	   
	File File2=new File("e:/","xiaohui.txt");
	  File2.createNewFile();
	  
	  File file3=new File("e:/");
	  File file4=new File(file3,"file3xiao");
	  file4.createNewFile();
	  System.out.println(file4.delete());
	  
	  File file5=new File("e:/a/b");
	  boolean file6=file5.mkdirs();
	  
	  File file7=new File("e:/a/b");
	  boolean file8=file7.mkdirs();
	  if (file8) {
		  System.out.println("创建成功");
	  }else{
		  System.out.println("创建失败");
	}
	  File file11=new File("e:/wang");
	  file11.canExecute();
	  System.out.println(file11.canExecute());//判断文件是否可执行
	  System.out.println(file11.canRead());//判断文件是否可读
	  System.out.println(file11.canWrite());//判断文件是否可写
	  System.out.println(file11.exists());//判断文件是否存在
	  System.out.println(file11.delete());//删除
	  file11.deleteOnExit();
	  
	  File fi=new File(".");
	  File absoluteFile = fi.getAbsoluteFile();
	  System.out.println(absoluteFile);
	  
	  File.createTempFile("xiaohui", ".arg1",new File("e/d") );
	  
	  
	  File ul=new File("e/d");
	  ul.getName();
}
}


	/*public static void main(String[] args) throws IOException {
	
		File one = new File("d:/" + File.separator);
		File[] oneList = one.listFiles(new FilenameFilter() {
			public boolean accept(File dir, String name) {
				return !name.contains(".");
			} 
		});
		for (File file : oneList) {
			System.out.println("第一级目录名为：" + file);
			String[] list = file.list(new FilenameFilter() {
				public boolean accept(File dir, String name) {
					return name.endsWith(".exe");
				}
			});
			if (list != null && list.length != 0) {
				for (String string : list) {
					System.out.println(string);
				}
			} else {
				System.out.println("该目录下没有exe文件");
			}
		}
		System.out.println("----------------------------------");
	}
	}*/
	













